//
//  AFNDownLoader.m
//  UI_Custon
//
//  Created by steven on 15/2/1.
//  Copyright (c) 2015年 steven. All rights reserved.
//

#import "AFNDownLoader.h"

@implementation AFNDownLoader

+ (instancetype)getDataDownLoad:(NSString *)strUrl block:(afnBlock)myBlock
{
    AFNDownLoader *afnDL = [[AFNDownLoader alloc] init];
    
    AFNetworkReachabilityManager *netWorkManager = [AFNetworkReachabilityManager sharedManager];
    
    
    AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager];
    
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"text/json",@"application/json",@"text/javascript",@"text/html",nil];
    
    [manager GET:strUrl parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [netWorkManager stopMonitoring];
        
        myBlock(responseObject);
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        NSLog(@"失败==== %@",error);
        
    }];

    return afnDL;
    
}







@end
